Optimal. Leaf size=121 \[ -\frac {a^2 d \cos (c+d x)}{2 x}+2 a b d \cos (c) \text {Ci}(d x)+b^2 \text {Ci}(d x) \sin (c)-\frac {1}{2} a^2 d^2 \text {Ci}(d x) \sin (c)-\frac {a^2 \sin (c+d x)}{2 x^2}-\frac {2 a b \sin (c+d x)}{x}+b^2 \cos (c) \text {Si}(d x)-\frac {1}{2} a^2 d^2 \cos (c) \text {Si}(d x)-2 a b d \sin (c) \text {Si}(d x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.24, antiderivative size = 121, normalized size of antiderivative = 1.00, number of steps
used = 14, number of rules used = 5, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {6874, 3378,
3384, 3380, 3383} \begin {gather*} -\frac {1}{2} a^2 d^2 \sin (c) \text {CosIntegral}(d x)-\frac {1}{2} a^2 d^2 \cos (c) \text {Si}(d x)-\frac {a^2 \sin (c+d x)}{2 x^2}-\frac {a^2 d \cos (c+d x)}{2 x}+2 a b d \cos (c) \text {CosIntegral}(d x)-2 a b d \sin (c) \text {Si}(d x)-\frac {2 a b \sin (c+d x)}{x}+b^2 \sin (c) \text {CosIntegral}(d x)+b^2 \cos (c) \text {Si}(d x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3378
Rule 3380
Rule 3383
Rule 3384
Rule 6874
Rubi steps
\begin {align*} \int \frac {(a+b x)^2 \sin (c+d x)}{x^3} \, dx &=\int \left (\frac {a^2 \sin (c+d x)}{x^3}+\frac {2 a b \sin (c+d x)}{x^2}+\frac {b^2 \sin (c+d x)}{x}\right ) \, dx\\ &=a^2 \int \frac {\sin (c+d x)}{x^3} \, dx+(2 a b) \int \frac {\sin (c+d x)}{x^2} \, dx+b^2 \int \frac {\sin (c+d x)}{x} \, dx\\ &=-\frac {a^2 \sin (c+d x)}{2 x^2}-\frac {2 a b \sin (c+d x)}{x}+\frac {1}{2} \left (a^2 d\right ) \int \frac {\cos (c+d x)}{x^2} \, dx+(2 a b d) \int \frac {\cos (c+d x)}{x} \, dx+\left (b^2 \cos (c)\right ) \int \frac {\sin (d x)}{x} \, dx+\left (b^2 \sin (c)\right ) \int \frac {\cos (d x)}{x} \, dx\\ &=-\frac {a^2 d \cos (c+d x)}{2 x}+b^2 \text {Ci}(d x) \sin (c)-\frac {a^2 \sin (c+d x)}{2 x^2}-\frac {2 a b \sin (c+d x)}{x}+b^2 \cos (c) \text {Si}(d x)-\frac {1}{2} \left (a^2 d^2\right ) \int \frac {\sin (c+d x)}{x} \, dx+(2 a b d \cos (c)) \int \frac {\cos (d x)}{x} \, dx-(2 a b d \sin (c)) \int \frac {\sin (d x)}{x} \, dx\\ &=-\frac {a^2 d \cos (c+d x)}{2 x}+2 a b d \cos (c) \text {Ci}(d x)+b^2 \text {Ci}(d x) \sin (c)-\frac {a^2 \sin (c+d x)}{2 x^2}-\frac {2 a b \sin (c+d x)}{x}+b^2 \cos (c) \text {Si}(d x)-2 a b d \sin (c) \text {Si}(d x)-\frac {1}{2} \left (a^2 d^2 \cos (c)\right ) \int \frac {\sin (d x)}{x} \, dx-\frac {1}{2} \left (a^2 d^2 \sin (c)\right ) \int \frac {\cos (d x)}{x} \, dx\\ &=-\frac {a^2 d \cos (c+d x)}{2 x}+2 a b d \cos (c) \text {Ci}(d x)+b^2 \text {Ci}(d x) \sin (c)-\frac {1}{2} a^2 d^2 \text {Ci}(d x) \sin (c)-\frac {a^2 \sin (c+d x)}{2 x^2}-\frac {2 a b \sin (c+d x)}{x}+b^2 \cos (c) \text {Si}(d x)-\frac {1}{2} a^2 d^2 \cos (c) \text {Si}(d x)-2 a b d \sin (c) \text {Si}(d x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.26, size = 95, normalized size = 0.79 \begin {gather*} \frac {1}{2} \left (\text {Ci}(d x) \left (4 a b d \cos (c)+\left (2 b^2-a^2 d^2\right ) \sin (c)\right )-\frac {a (a d x \cos (c+d x)+(a+4 b x) \sin (c+d x))}{x^2}+\left (\left (2 b^2-a^2 d^2\right ) \cos (c)-4 a b d \sin (c)\right ) \text {Si}(d x)\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 114, normalized size = 0.94
method | result | size |
derivativedivides | \(d^{2} \left (a^{2} \left (-\frac {\sin \left (d x +c \right )}{2 d^{2} x^{2}}-\frac {\cos \left (d x +c \right )}{2 d x}-\frac {\sinIntegral \left (d x \right ) \cos \left (c \right )}{2}-\frac {\cosineIntegral \left (d x \right ) \sin \left (c \right )}{2}\right )+\frac {2 a b \left (-\frac {\sin \left (d x +c \right )}{d x}-\sinIntegral \left (d x \right ) \sin \left (c \right )+\cosineIntegral \left (d x \right ) \cos \left (c \right )\right )}{d}+\frac {b^{2} \left (\sinIntegral \left (d x \right ) \cos \left (c \right )+\cosineIntegral \left (d x \right ) \sin \left (c \right )\right )}{d^{2}}\right )\) | \(114\) |
default | \(d^{2} \left (a^{2} \left (-\frac {\sin \left (d x +c \right )}{2 d^{2} x^{2}}-\frac {\cos \left (d x +c \right )}{2 d x}-\frac {\sinIntegral \left (d x \right ) \cos \left (c \right )}{2}-\frac {\cosineIntegral \left (d x \right ) \sin \left (c \right )}{2}\right )+\frac {2 a b \left (-\frac {\sin \left (d x +c \right )}{d x}-\sinIntegral \left (d x \right ) \sin \left (c \right )+\cosineIntegral \left (d x \right ) \cos \left (c \right )\right )}{d}+\frac {b^{2} \left (\sinIntegral \left (d x \right ) \cos \left (c \right )+\cosineIntegral \left (d x \right ) \sin \left (c \right )\right )}{d^{2}}\right )\) | \(114\) |
risch | \(-\cos \left (c \right ) \expIntegral \left (1, i d x \right ) a b d -\cos \left (c \right ) \expIntegral \left (1, -i d x \right ) a b d +\frac {i \cos \left (c \right ) \expIntegral \left (1, i d x \right ) a^{2} d^{2}}{4}-\frac {i \cos \left (c \right ) \expIntegral \left (1, -i d x \right ) a^{2} d^{2}}{4}-\frac {i \cos \left (c \right ) \expIntegral \left (1, i d x \right ) b^{2}}{2}+\frac {i \cos \left (c \right ) \expIntegral \left (1, -i d x \right ) b^{2}}{2}+i \sin \left (c \right ) \expIntegral \left (1, i d x \right ) a b d -i \sin \left (c \right ) \expIntegral \left (1, -i d x \right ) a b d +\frac {\sin \left (c \right ) \expIntegral \left (1, i d x \right ) a^{2} d^{2}}{4}+\frac {\sin \left (c \right ) \expIntegral \left (1, -i d x \right ) a^{2} d^{2}}{4}-\frac {\sin \left (c \right ) \expIntegral \left (1, i d x \right ) b^{2}}{2}-\frac {\sin \left (c \right ) \expIntegral \left (1, -i d x \right ) b^{2}}{2}-\frac {a^{2} d \cos \left (d x +c \right )}{2 x}+\frac {\left (-8 a b \,d^{4} x^{3}-2 a^{2} d^{4} x^{2}\right ) \sin \left (d x +c \right )}{4 d^{4} x^{4}}\) | \(239\) |
meijerg | \(\frac {b^{2} \sqrt {\pi }\, \sin \left (c \right ) \left (\frac {2 \gamma +2 \ln \left (x \right )+\ln \left (d^{2}\right )}{\sqrt {\pi }}-\frac {2 \gamma }{\sqrt {\pi }}-\frac {2 \ln \left (2\right )}{\sqrt {\pi }}-\frac {2 \ln \left (\frac {d x}{2}\right )}{\sqrt {\pi }}+\frac {2 \cosineIntegral \left (d x \right )}{\sqrt {\pi }}\right )}{2}+b^{2} \cos \left (c \right ) \sinIntegral \left (d x \right )+\frac {d^{2} a b \sqrt {\pi }\, \sin \left (c \right ) \left (-\frac {4 d^{2} \cos \left (x \sqrt {d^{2}}\right )}{x \left (d^{2}\right )^{\frac {3}{2}} \sqrt {\pi }}-\frac {4 \sinIntegral \left (x \sqrt {d^{2}}\right )}{\sqrt {\pi }}\right )}{2 \sqrt {d^{2}}}+\frac {d a b \sqrt {\pi }\, \cos \left (c \right ) \left (\frac {4 \gamma -4+4 \ln \left (x \right )+4 \ln \left (d \right )}{\sqrt {\pi }}+\frac {4}{\sqrt {\pi }}-\frac {4 \gamma }{\sqrt {\pi }}-\frac {4 \ln \left (2\right )}{\sqrt {\pi }}-\frac {4 \ln \left (\frac {d x}{2}\right )}{\sqrt {\pi }}-\frac {4 \sin \left (d x \right )}{\sqrt {\pi }\, d x}+\frac {4 \cosineIntegral \left (d x \right )}{\sqrt {\pi }}\right )}{2}+\frac {a^{2} \sqrt {\pi }\, \sin \left (c \right ) d^{2} \left (-\frac {4}{\sqrt {\pi }\, x^{2} d^{2}}-\frac {2 \left (2 \gamma -3+2 \ln \left (x \right )+\ln \left (d^{2}\right )\right )}{\sqrt {\pi }}+\frac {-6 d^{2} x^{2}+4}{\sqrt {\pi }\, x^{2} d^{2}}+\frac {4 \gamma }{\sqrt {\pi }}+\frac {4 \ln \left (2\right )}{\sqrt {\pi }}+\frac {4 \ln \left (\frac {d x}{2}\right )}{\sqrt {\pi }}-\frac {4 \cos \left (d x \right )}{\sqrt {\pi }\, d^{2} x^{2}}+\frac {4 \sin \left (d x \right )}{\sqrt {\pi }\, d x}-\frac {4 \cosineIntegral \left (d x \right )}{\sqrt {\pi }}\right )}{8}+\frac {a^{2} \sqrt {\pi }\, \cos \left (c \right ) d^{2} \left (-\frac {4 \cos \left (d x \right )}{d x \sqrt {\pi }}-\frac {4 \sin \left (d x \right )}{d^{2} x^{2} \sqrt {\pi }}-\frac {4 \sinIntegral \left (d x \right )}{\sqrt {\pi }}\right )}{8}\) | \(386\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 1.40, size = 189, normalized size = 1.56 \begin {gather*} -\frac {{\left ({\left (a^{2} {\left (-i \, \Gamma \left (-2, i \, d x\right ) + i \, \Gamma \left (-2, -i \, d x\right )\right )} \cos \left (c\right ) - a^{2} {\left (\Gamma \left (-2, i \, d x\right ) + \Gamma \left (-2, -i \, d x\right )\right )} \sin \left (c\right )\right )} d^{4} + 4 \, {\left (a b {\left (\Gamma \left (-2, i \, d x\right ) + \Gamma \left (-2, -i \, d x\right )\right )} \cos \left (c\right ) - a b {\left (i \, \Gamma \left (-2, i \, d x\right ) - i \, \Gamma \left (-2, -i \, d x\right )\right )} \sin \left (c\right )\right )} d^{3} - 2 \, {\left (b^{2} {\left (-i \, \Gamma \left (-2, i \, d x\right ) + i \, \Gamma \left (-2, -i \, d x\right )\right )} \cos \left (c\right ) - b^{2} {\left (\Gamma \left (-2, i \, d x\right ) + \Gamma \left (-2, -i \, d x\right )\right )} \sin \left (c\right )\right )} d^{2}\right )} x^{2} + 2 \, b^{2} \sin \left (d x + c\right ) + 2 \, {\left (b^{2} d x + 2 \, a b d\right )} \cos \left (d x + c\right )}{2 \, d^{2} x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 147, normalized size = 1.21 \begin {gather*} -\frac {2 \, a^{2} d x \cos \left (d x + c\right ) - 2 \, {\left (2 \, a b d x^{2} \operatorname {Ci}\left (d x\right ) + 2 \, a b d x^{2} \operatorname {Ci}\left (-d x\right ) - {\left (a^{2} d^{2} - 2 \, b^{2}\right )} x^{2} \operatorname {Si}\left (d x\right )\right )} \cos \left (c\right ) + 2 \, {\left (4 \, a b x + a^{2}\right )} \sin \left (d x + c\right ) + {\left (8 \, a b d x^{2} \operatorname {Si}\left (d x\right ) + {\left (a^{2} d^{2} - 2 \, b^{2}\right )} x^{2} \operatorname {Ci}\left (d x\right ) + {\left (a^{2} d^{2} - 2 \, b^{2}\right )} x^{2} \operatorname {Ci}\left (-d x\right )\right )} \sin \left (c\right )}{4 \, x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a + b x\right )^{2} \sin {\left (c + d x \right )}}{x^{3}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 4.33, size = 1182, normalized size = 9.77 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\sin \left (c+d\,x\right )\,{\left (a+b\,x\right )}^2}{x^3} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________